From d16329f311cb0ec9c4ad60844905e8d02f275bd0 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Wed, 30 Apr 2008 23:49:28 +0000 Subject: [PATCH] Make the hack from r33376 conditional... This'll put the username field back in except where disabled (due to need to fix up indexes on wikipedia sites) --- includes/DefaultSettings.php | 5 +++++ includes/SpecialNewpages.php | 22 ++++++++++++++-------- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 93f04877d0..cbcba2e9f1 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -1892,6 +1892,11 @@ $wgRC2UDPAddress = false; $wgRC2UDPPort = false; $wgRC2UDPPrefix = ''; +# Enable user search in Special:Newpages +# This is really a temporary hack around an index install bug on some Wikipedias. +# Kill it once fixed. +$wgEnableNewpagesUserFilter = true; + # # Copyright and credits settings # diff --git a/includes/SpecialNewpages.php b/includes/SpecialNewpages.php index 617c0559df..6f8fad9c8e 100644 --- a/includes/SpecialNewpages.php +++ b/includes/SpecialNewpages.php @@ -28,6 +28,7 @@ class NewPagesForm { */ public function showList( $par, $including ) { global $wgScript, $wgLang, $wgGroupPermissions, $wgRequest, $wgUser, $wgOut; + global $wgEnableNewpagesUserFilter; $sk = $wgUser->getSkin(); $self = SpecialPage::getTitleFor( 'NewPages' ); @@ -95,8 +96,10 @@ class NewPagesForm { } } - // hack disable - $options['username'] = ''; + if( !$wgEnableNewpagesUserFilter ) { + // hack disable + $options['username'] = ''; + } if( !$including ){ $wgOut->setSyndicated( true ); @@ -146,18 +149,17 @@ class NewPagesForm { " . Xml::namespaceSelector( $options['namespace'], 'all' ) . " - - - + " : "" ) . + " " . Xml::submitButton( wfMsg( 'allpagessubmit' ) ) . " @@ -345,6 +347,7 @@ class NewPagesPager extends ReverseChronologicalPager { } function getQueryInfo() { + global $wgEnableNewpagesUserFilter; $conds = $this->mConds; $conds['rc_new'] = 1; if( $this->namespace !== false ) { @@ -353,6 +356,9 @@ class NewPagesPager extends ReverseChronologicalPager { } else { $rcIndexes = array( 'rc_timestamp' ); } + if( $wgEnableNewpagesUserFilter ) { + $rcIndex[] = 'rc_user_text'; + } $conds[] = 'page_id = rc_cur_id'; $conds['page_is_redirect'] = 0; -- 2.20.1